package com.jingbo.service.record;

import com.jingbo.DAO.Record.pecordimpl;
import com.jingbo.entity.Profile;

import java.util.List;

/**
 * @author jiangjingbo
 * @version V1.0
 * @Project java2203
 * @Package com.jingbo.service.record
 * @Description:
 * @Date 2022/5/27 14:59
 */
public class recordimpl implements record {
    private pecordimpl pec;

    public recordimpl(com.jingbo.DAO.Record.pecordimpl pec) {
        this.pec = pec;
    }

    /**
     * 添加档案
     * @param profile
     * @return
     */
    @Override
    public Boolean Addrecord(Profile profile) {
        return pec.AddPecord(profile)!=0;
    }

    /**
     * 查看所有
     * @return
     */
    @Override
    public List<Profile> selectProfile() {
        List<Profile> list = pec.selectPecord();
        return list;
    }

    /**
     * 根据id删除
     * @param id
     * @return
     */
    @Override
    public boolean deleteOne(Integer id) {
        return  pec.delete(id)!=0;
    }

    /**
     * 根据id查询
     * @param id
     * @return
     */
    @Override
    public Profile allone(Integer id) {
        Profile allone = pec.allone(id);
        return allone;
    }

    /**
     * 根据id修改信息
     * @param profile
     * @param id
     * @return
     */
    @Override
    public boolean updateOne(Profile profile, Integer id) {
        return pec.update(profile, id)!=0;
    }

    /**
     *  查询总条数
     */

    @Override
    public Integer Countpaging() {
        return pec.countpaging();
    }

    /**
     * 分页查询
     * @param aa
     * @param bb
     * @return
     */
    @Override
    public List<Profile> profileall(Integer aa, Integer bb) {
        List<Profile> all = pec.all(aa, bb);

        return all;
    }


}
